.class public Lcom/brixd/niceapp/db/AppEntity;
.super Ljava/lang/Object;
.source "AppEntity.java"


# instance fields
.field private appId:Ljava/lang/Long;

.field private json:Ljava/lang/String;

.field private subTitle:Ljava/lang/String;

.field private tags:Ljava/lang/String;

.field private title:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 29
    return-void
.end method

.method public constructor <init>(Ljava/lang/Long;)V
    .registers 2
    .param p1, "appId"    # Ljava/lang/Long;

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->appId:Ljava/lang/Long;

    .line 33
    return-void
.end method

.method public constructor <init>(Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .registers 6
    .param p1, "appId"    # Ljava/lang/Long;
    .param p2, "title"    # Ljava/lang/String;
    .param p3, "subTitle"    # Ljava/lang/String;
    .param p4, "tags"    # Ljava/lang/String;
    .param p5, "json"    # Ljava/lang/String;

    .prologue
    .line 35
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 36
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->appId:Ljava/lang/Long;

    .line 37
    iput-object p2, p0, Lcom/brixd/niceapp/db/AppEntity;->title:Ljava/lang/String;

    .line 38
    iput-object p3, p0, Lcom/brixd/niceapp/db/AppEntity;->subTitle:Ljava/lang/String;

    .line 39
    iput-object p4, p0, Lcom/brixd/niceapp/db/AppEntity;->tags:Ljava/lang/String;

    .line 40
    iput-object p5, p0, Lcom/brixd/niceapp/db/AppEntity;->json:Ljava/lang/String;

    .line 41
    return-void
.end method

.method public static parseAppEntities(Lorg/json/JSONArray;)Ljava/util/ArrayList;
    .registers 4
    .param p0, "apps"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/db/AppEntity;",
            ">;"
        }
    .end annotation

    .prologue
    .line 91
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 93
    .local v0, "appEntities":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/db/AppEntity;>;"
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_6
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v2

    if-ge v1, v2, :cond_1a

    .line 94
    invoke-virtual {p0, v1}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    invoke-static {v2}, Lcom/brixd/niceapp/db/AppEntity;->parseAppEntity(Lorg/json/JSONObject;)Lcom/brixd/niceapp/db/AppEntity;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 93
    add-int/lit8 v1, v1, 0x1

    goto :goto_6

    .line 97
    :cond_1a
    return-object v0
.end method

.method public static parseAppEntity(Lorg/json/JSONObject;)Lcom/brixd/niceapp/db/AppEntity;
    .registers 5
    .param p0, "jsonApp"    # Lorg/json/JSONObject;

    .prologue
    .line 101
    new-instance v0, Lcom/brixd/niceapp/db/AppEntity;

    invoke-direct {v0}, Lcom/brixd/niceapp/db/AppEntity;-><init>()V

    .line 102
    .local v0, "appEntity":Lcom/brixd/niceapp/db/AppEntity;
    const-string v1, "id"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optLong(Ljava/lang/String;)J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/AppEntity;->setAppId(Ljava/lang/Long;)V

    .line 103
    const-string v1, "sub_title"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/AppEntity;->setSubTitle(Ljava/lang/String;)V

    .line 104
    const-string v1, "tags"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/AppEntity;->setTags(Ljava/lang/String;)V

    .line 105
    const-string v1, "title"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/AppEntity;->setTitle(Ljava/lang/String;)V

    .line 106
    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/AppEntity;->setJson(Ljava/lang/String;)V

    .line 108
    return-object v0
.end method


# virtual methods
.method public getAppId()Ljava/lang/Long;
    .registers 2

    .prologue
    .line 44
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppEntity;->appId:Ljava/lang/Long;

    return-object v0
.end method

.method public getJson()Ljava/lang/String;
    .registers 2

    .prologue
    .line 81
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppEntity;->json:Ljava/lang/String;

    return-object v0
.end method

.method public getSubTitle()Ljava/lang/String;
    .registers 2

    .prologue
    .line 63
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppEntity;->subTitle:Ljava/lang/String;

    return-object v0
.end method

.method public getTags()Ljava/lang/String;
    .registers 2

    .prologue
    .line 72
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppEntity;->tags:Ljava/lang/String;

    return-object v0
.end method

.method public getTitle()Ljava/lang/String;
    .registers 2

    .prologue
    .line 53
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppEntity;->title:Ljava/lang/String;

    return-object v0
.end method

.method public setAppId(Ljava/lang/Long;)V
    .registers 2
    .param p1, "appId"    # Ljava/lang/Long;

    .prologue
    .line 48
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->appId:Ljava/lang/Long;

    .line 49
    return-void
.end method

.method public setJson(Ljava/lang/String;)V
    .registers 2
    .param p1, "json"    # Ljava/lang/String;

    .prologue
    .line 86
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->json:Ljava/lang/String;

    .line 87
    return-void
.end method

.method public setSubTitle(Ljava/lang/String;)V
    .registers 2
    .param p1, "subTitle"    # Ljava/lang/String;

    .prologue
    .line 68
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->subTitle:Ljava/lang/String;

    .line 69
    return-void
.end method

.method public setTags(Ljava/lang/String;)V
    .registers 2
    .param p1, "tags"    # Ljava/lang/String;

    .prologue
    .line 76
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->tags:Ljava/lang/String;

    .line 77
    return-void
.end method

.method public setTitle(Ljava/lang/String;)V
    .registers 2
    .param p1, "title"    # Ljava/lang/String;

    .prologue
    .line 58
    iput-object p1, p0, Lcom/brixd/niceapp/db/AppEntity;->title:Ljava/lang/String;

    .line 59
    return-void
.end method
